package kr.re.etri.snsenabler.client;


public class Copy_2_of_AuthoringTool {

//	private static AuthoringUiBinder uiBinder = GWT.create(AuthoringUiBinder.class);
//
//	interface AuthoringUiBinder extends UiBinder<Widget, Copy_2_of_AuthoringTool> {
//	}
//
//	private final SnsEnablerServiceAsync snsEnablerService = GWT.create(SnsEnablerService.class);
//	@SuppressWarnings("unused") private final Logger logger = Logger.getLogger(getClass().getName());
//
//	private final Data user;
//	private final SocialServiceProviderBundle bundle = GWT.create(SocialServiceProviderBundle.class);
//	private BorderLayoutContainer container;
//	@UiField ContentPanel socialServiceProvidersPanel;
//	private AccordionLayoutContainer accordionPanel;
//	@UiField ContentPanel printoutPanel;
//	@UiField(provided = true) BorderLayoutData westData = new BorderLayoutData(150);
//	@UiField(provided = true) MarginData centerData = new MarginData();
//
//	public Copy_2_of_AuthoringTool(Data user) {
//		super();
//
//		this.user = user;
//
//		container = (BorderLayoutContainer)uiBinder.createAndBindUi(this);
//		container.setPixelSize(Window.getClientWidth(), Window.getClientHeight());
//
//		westData.setMargins(new Margins(10));
//		centerData.setMargins(new Margins(10, 10, 10, 0));
//
//		loadSocialServiceProviders();
//	}
//
//	private void loadSocialServiceProviders() {
//		snsEnablerService.loadJoinedSocialServiceProviders(user.getString(LoginProperties.LOGIN_ID), new AsyncCallback<ServiceResponse>() {
//			public void onFailure(Throwable caught) {
//				AlertMessageBox messageBox = new AlertMessageBox("Alert", "Invalid Authorization");
//				messageBox.show();
//			}
//
//			public void onSuccess(ServiceResponse response) {
//				if (response.isFailed()) {
//
//				} else {
//					socialServiceProvidersLoaded(response.getDataList());
//				}
//			}
//		});
//	}
//
//	private void socialServiceProvidersLoaded(ArrayList<Data> dataList) {
//		AccordionLayoutAppearance appearance = GWT.create(AccordionLayoutAppearance.class);
//
//		accordionPanel = new AccordionLayoutContainer();
//		accordionPanel.setExpandMode(ExpandMode.SINGLE_FILL);
//
//		for (int i = 0; i < SocialServiceProvider.values().length; i++) {
//			SocialServiceProvider socialServiceProvider = SocialServiceProvider.values()[i];
//			boolean isUsing = false;
//			String userId = null;
//			for (int j = 0; j < dataList.size(); j++) {
//				String providerName = dataList.get(j).getString(SocialServiceProperties.SERVICE_PROVIDER);
//				SocialServiceProvider usingSocialServiceProvider = SocialServiceProvider.fromName(providerName);
//				if (socialServiceProvider == usingSocialServiceProvider) {
//					isUsing = true;
//					userId = dataList.get(j).getString(SocialServiceProperties.USER_ID);
//					break;
//				}
//			}
//
//			ImageResource icon = getIcon(socialServiceProvider);
//			ServiceProviderPanel serviceProviderPanel = new ServiceProviderPanel(appearance, user, socialServiceProvider, isUsing, icon);
//			serviceProviderPanel.setAnimCollapse(false);
//			serviceProviderPanel.setHeadingText(socialServiceProvider.getTitle() + "(" + userId + ")");
//			accordionPanel.add(serviceProviderPanel);
//			if (i == 0) {
//				accordionPanel.setActiveWidget(serviceProviderPanel);
//			}
//		}
//
//		socialServiceProvidersPanel.setWidget(accordionPanel);
//	}
//
//	private ImageResource getIcon(SocialServiceProvider socialService) {
//		switch (socialService) {
//			case Daum:
//				return bundle.daum();
//			case Naver:
//				return bundle.naver();
//			case Twitter:
//				return bundle.twitter();
//			case Facebook:
//				return bundle.facebook();
//			default:
//				break;
//		}
//		return null;
//	}
//
//	protected SimpleContainer getContainer() {
//		return container;
//	}
}
